<ng-template #checkboxTemplate>
  <label
    [class.ant-table-selection-select-all-custom]="nzShowRowSelection"
    nz-checkbox
    [(ngModel)]="nzChecked"
    [nzDisabled]="nzDisabled"
    [nzIndeterminate]="nzIndeterminate"
    (ngModelChange)="nzCheckedChange.emit($event)">
  </label>
</ng-template>
<div [class.ant-table-column-sorters]="nzShowSort" (click)="updateSortValue()">
  <div class="ant-table-selection" *ngIf="nzShowRowSelection">
    <ng-container *ngIf="nzShowCheckbox">
      <ng-template [ngTemplateOutlet]="checkboxTemplate"></ng-template>
    </ng-container>
    <nz-dropdown nzPlacement="bottomLeft">
      <div nz-dropdown class="ant-table-selection-down">
        <i nz-icon type="down"></i>
      </div>
      <ul nz-menu class="ant-table-selection-menu">
        <li nz-menu-item *ngFor="let selection of nzSelections" (click)="selection.onSelect()">{{selection.text}}</li>
      </ul>
    </nz-dropdown>
  </div>
  <ng-container *ngIf="nzShowCheckbox && !nzShowRowSelection">
    <ng-template [ngTemplateOutlet]="checkboxTemplate"></ng-template>
  </ng-container>
  <ng-content></ng-content>
  <div class="ant-table-column-sorter" *ngIf="nzShowSort">
    <i nz-icon
      type="caret-up"
      class="ant-table-column-sorter-up"
      [class.on]="nzSort == 'ascend'"
      [class.off]="nzSort != 'ascend'"></i>
    <i nz-icon
      type="caret-down"
      class="ant-table-column-sorter-down"
      [class.on]="nzSort == 'descend'"
      [class.off]="nzSort != 'descend'"></i>
  </div>
</div>
<nz-dropdown nzTrigger="click" *ngIf="nzShowFilter" [nzClickHide]="false" [hasFilterButton]="true" (nzVisibleChange)="dropDownVisibleChange($event)">
  <i nz-icon type="filter" theme="fill" [class.ant-table-filter-selected]="hasFilterValue" [class.ant-table-filter-open]="filterVisible" nz-dropdown></i>
  <ul nz-menu>
    <ng-container *ngIf="nzFilterMultiple">
      <li nz-menu-item *ngFor="let filter of multipleFilterList" (click)="checkMultiple(filter)">
        <label nz-checkbox [ngModel]="filter.checked"></label><span>{{filter.text}}</span>
      </li>
    </ng-container>
    <ng-container *ngIf="!nzFilterMultiple">
      <li nz-menu-item *ngFor="let filter of singleFilterList" (click)="checkSingle(filter)">
        <label nz-radio [ngModel]="filter.checked">{{filter.text}}</label>
      </li>
    </ng-container>
  </ul>
  <div class="ant-table-filter-dropdown-btns">
    <a class="ant-table-filter-dropdown-link confirm" (click)="hideDropDown()">
      <span (click)="search()">{{'Table.filterConfirm' | nzI18n}}</span>
    </a>
    <a class="ant-table-filter-dropdown-link clear" (click)="hideDropDown()">
      <span (click)="reset()">{{'Table.filterReset' | nzI18n}}</span>
    </a>
  </div>
</nz-dropdown>
